//- 先去这个pug文件中找
extends ../commons/commons.pug

block append pageStyle
	link(href="${relativePath}/static/css/shopping/shopIndex.css" rel="stylesheet" type="text/css")
	link(href="${relativePath}/static/css/shopping/madeProcess.css" rel="stylesheet" type="text/css")
	link(href="${relativePath}/static/css/shopping/orderDetails.css" rel="stylesheet" type="text/css")

block content
	//- 订单详情内容
	div.orderContent
		div.orderTitle 订单详情
		div.orderBig
			div.numBox
				p.orderNum 
					| 订单编号：
					| <span></span>
				p.orderStatus
					| 订单状态：
					| <span> </span>
			//- 商品清单
			div.goodsList
				h3 商品清单
				div.businessBox
					div.busHead.cpclBus.showIDS
						p.designBus
							| 指定商家：
							| <span></span>
						div.detailBox.detailsBox
							p.phone
								| 商家电话：
								| <span></span>
							p.adress
								| 商家地址：
								| <span></span>
						
				div.ordeDetails
					div.detailTitle
						ul.title
							li.name 商品名称
							li.detail 订单详情
							li.unitPrice 单价
							li.number.member 数量
							li.all 总价
					div.goodsCon
						div.guigLists
							//- div.allBox.newAllBox
							//- 	div.commonDiv.goodsName.fl
							//- 		div.imgBox.fl
							//- 			img(src="")
							//- 		div.titleName.fl
							//- 			p.title.common 
							//- 	div.detailBox.fl
							//- 		//- 规格列表
							//- 		ul

							//- 	div.singlePrice.fl
							//- 		p.realPrice
							//- 	div.buyNum.fl
							//- 	div.allPrice
							
						//- div.line.clear
						//- //- 附件
						//- div.designBox
						//- 	div.designImg
						//- 		span.pic.fl  效果图：
						//- 		ul.fl
						//- 			li.fl
						//- 				img(src="${relativePath}/static/imgs/small.png")
						//- 	div.designImg.closeure
						//- 		span.pic.txt.fl &nbsp;&nbsp;&nbsp;附件：
						//- 		div.txtBox.fl
						//- 			p.list
						//- 				| 标识汇-智能商城.pptx  (34.07M)
						//- 				| <span class="delete fr"></span>
					//- 订单总额
					div.orderAll.fr
						| 订单总额
						| <i>￥</i><span></span>
			//- 详细地址
			div.goodsList.detailAdress
				h3 详细地址
				ul
					li
						span.name 收货人：
						span.content#name
					li
						span.name 收货地址：
						span.content#addressOne 
					li
						span.name 联系电话：
						span.content#phone
			//- 订单追踪

			div.goodsList.detailAdress.track
				h3 订单追踪
				ul.firstOne
					//- li
					//- 	span.name 物流公司：
					//- 	span.content 圆通快递
					//- 	a.networkBtn(href="javscript:;") 点击进入物流网
					//- li
					//- 	span.name 物流单号：
					//- 	span.content 884525215425200100021
					li
						span.name.fl 订单跟踪：
						div.trackInfo.fl
							ul.twoList
								
								//- li
								//- 	div.circle
								//- 	div.rightTxt
								//- 		p 订单已发货
								//- 		p 2017-11-10   16:10
	//- 规格列表模板
	script#newsList(type="text/html")
		| {{set news = data.goods}}
		div.allBox.newAllBox
			div.commonDiv.goodsName.fl
				div.imgBox.fl
					img(src="{{news.img}}")
				div.titleName.fl
					p.title.common 广告设计
			div.detailBox.detailBox_s.fl
				//- 规格列表
				| {{set goods = news.sku_list}}
				ul
					| {{each goods arr2}}
					li {{arr2.sku_name}}：{{arr2.value}}
					| {{/each}}
			div.singlePrice.fl
				p.realPrice {{news.amount_price}}
			div.buyNum.fl 1
			div.allPrice {{news.amount_price}}
	
	//- 附件及效果图模板	
	script#imgsHtml(type="text/html")
		| {{set imgData = data.goods.order_img}}
		| {{if imgData != ""}}
		div.line.clear
		//- 附件
		div.designBox
			div.designImg
				span.pic.fl  效果图：
				ul.fl
					| {{each imgData arr}}
					li.fl
						img(src="{{arr}}")
					| {{/each}}
		| {{/if}}

		| {{set files = data.goods.order_files}}
		| {{if files != ""}}
		div.designImg.closeure
			span.pic.txt.fl &nbsp;&nbsp;&nbsp;附件：
			div.txtBox.fl
				a(href="{{files}}").list
					| 标识汇-智能商城
					| <span class="delete fr"></span>	
		| {{/if}}

	

block append pageScript
	script.
		$(function(){
			$(".left span").click(function(){
				$(this).addClass("current").siblings().removeClass("current");
			})
			//- 订单详情
			$.getJSON(shopIp+"/Order/info?callback=?",{
				userToken:token,
				os:"web",
				order_id:thisRequest.order_id,
				user_identity:"buyer"
			},function(data){
				//- 订单编号
				if(data.status == 200){
					var data1 = data.data;
					//console.log(data1.goods.order_files);
					var goods = data1.goods;
					var allcounts = goods.amount_price;
					//- 状态显示
					var show = goods.is_show;
					$(".orderNum span").html(goods.order_sn);
					$(".orderStatus span").html(goods.order_state);
					$(".designBus span").html(goods.sell_name);
					$(".phone span").html(goods.sell_phone);
					$(".adress span").html(goods.sell_address);
					
					$(".orderAll span").html(allcounts);
					//console.log(goods.img);
					$(".imgBox img").attr("src",goods.img);
					$(".titleName .title").html(goods.goods_name);
					//- 规格信息列表
					
					var newslistss = template("newsList",data);
					//console.log(newslistss);
					$(".guigLists").append(newslistss);
					//- 当状态值为1时商家信息显示
					if(show == "1") {
						$(".cpclBus").show();
					} else{
						$(".cpclBus").hide();
					}
					//- 物流信息
					var logist = data1.order_message;
					for(var i=0;i<logist.length;i++) {
						var logistEle = '<li class="current"><div class="circle"></div><div class="rightTxt"></div><p>'+logist[i].message+'</p><p>'+logist[i].create_time+'</p></li>';
						$(".twoList").append(logistEle);
					}
					//- 收货信息
					var reciver = data1.reciver;
					$("#addressOne").html(reciver.reciver_address);
					$("#phone").html(reciver.reciver_mobile);
					$("#name").html(reciver.reciver_name);
					
					//- 效果图
					var imgsEle = template("imgsHtml",data);
					$(".allBox").after(imgsEle);
				}else{
					layer.msg(data.msg);
				}
			})
			
		})